<?php

namespace App\Http\Resources;

use App\Models\Card;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

/** @mixin Card */
class CardResource extends JsonResource
{
    /**
     * @param Request $request
     * @return array
     */
    public function toArray($request): array
    {
        return [
            'id' => $this->id,
            'bank_id' => $this->bank_id,
            'user_id' => $this->user_id,
            'number' => $this->number,
            'username' => $this->username,
            'phone' => $this->phone,
            'email' => $this->email,
            'ifsc' => $this->ifsc,
            'created_at' => (string)$this->created_at,
            'updated_at' => (string)$this->updated_at,
        ];
    }
}
